<?php
/**
 * MineAdmin is committed to providing solutions for quickly building web applications
 * Please view the LICENSE file that was distributed with this source code,
 * For the full copyright and license information.
 * Thank you very much for using MineAdmin.
 *
 * @Author X.Mo<root@imoi.cn>
 * @Link   https://gitee.com/xmo/MineAdmin
 */
declare(strict_types=1);

namespace Newbie\Crontab;


class NewbieCrontab {
    /**
     * 失败策略
     * @var string
     */
    protected string $failPolicy = '3';

    /**
     * 调用参数
     * @var string
     */
    protected string $parameter;

    /**
     * 任务ID
     * @var integer
     */
    protected int $crontab_id;

    protected bool $enable;
    protected mixed $callback;
    protected string $type;
    protected string $name;
    protected string $rule;
    protected int $executeTime;
    protected string $target;

    /**
     * @return string
     */
    public function getFailPolicy (): string {
        return $this->failPolicy;
    }

    /**
     * @param string $failPolicy
     */
    public function setFailPolicy (string $failPolicy): void {
        $this->failPolicy = $failPolicy;
    }

    /**
     * @return string
     */
    public function getParameter (): string {
        return $this->parameter;
    }

    /**
     * @param string $parameter
     */
    public function setParameter (string $parameter): void {
        $this->parameter = $parameter;
    }

    /**
     * @return int
     */
    public function getCrontabId (): int {
        return $this->crontab_id;
    }

    /**
     * @param int $crontab_id
     */
    public function setCrontabId (int $crontab_id): void {
        $this->crontab_id = $crontab_id;
    }

    public function setEnable (bool $enable): static {
        $this->enable = $enable;
        return $this;
    }

    public function setCallback ($callback): static {
        $this->callback = $callback;
        return $this;
    }

    public function setType ($type): static {
        $this->type = $type;
        return $this;
    }

    public function setName ($name): static {
        $this->name = $name;
        return $this;
    }

    public function setRule ($rule): static {
        $this->rule = $rule;
        return $this;
    }

    public function getExecuteTime (): int {
        return $this->executeTime;
    }

    public function getType (): string {
        return $this->type;
    }

    public function getCallback () {
        return $this->callback;
    }

    public function getName (): string {
        return $this->name;
    }

    public function getTarget (): string {
        return $this->target;
    }

    public function setTarget ($target): static {
        $this->target = $target;
        return $this;
    }

    public function getRule (): string {
        return $this->rule;
    }

}